import { http } from "../utils/http"
import {questiontype,questionListParams,questionList} from "../Model/question"

export interface typeData {
  id: number,
  name: string
  displayNewestFlag: number
}

interface tokenData {
  data: questiontype[],
  msg: string,
  code: number
}
interface  dataa{
  total: number,
  pageTotal: number,
  rows:questionList[]
}
interface quesData {
  data:dataa,
  pageTotal:number
  msg: string,
  code: number
}

export const questiontypedata = (): Promise<tokenData> => {
  return http.get<tokenData>("question/type")
}
export const questionlistdata = (data:questionListParams): Promise<quesData> => {

  return http.get<quesData>("question/list",data)
}
